package com.ruoyi.sale.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sale.mapper.SaleOrderItemMapper;
import com.ruoyi.sale.domain.SaleOrderItem;
import com.ruoyi.sale.service.ISaleOrderItemService;
import com.ruoyi.common.core.text.Convert;

/**
 * 销售订单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class SaleOrderItemServiceImpl implements ISaleOrderItemService 
{
    @Autowired
    private SaleOrderItemMapper saleOrderItemMapper;

    /**
     * 查询销售订单明细
     * 
     * @param itemId 销售订单明细主键
     * @return 销售订单明细
     */
    @Override
    public SaleOrderItem selectSaleOrderItemByItemId(Long itemId)
    {
        return saleOrderItemMapper.selectSaleOrderItemByItemId(itemId);
    }

    /**
     * 查询销售订单明细列表
     * 
     * @param saleOrderItem 销售订单明细
     * @return 销售订单明细
     */
    @Override
    public List<SaleOrderItem> selectSaleOrderItemList(SaleOrderItem saleOrderItem)
    {
        return saleOrderItemMapper.selectSaleOrderItemList(saleOrderItem);
    }

    /**
     * 新增销售订单明细
     * 
     * @param saleOrderItem 销售订单明细
     * @return 结果
     */
    @Override
    public int insertSaleOrderItem(SaleOrderItem saleOrderItem)
    {
        return saleOrderItemMapper.insertSaleOrderItem(saleOrderItem);
    }

    /**
     * 修改销售订单明细
     * 
     * @param saleOrderItem 销售订单明细
     * @return 结果
     */
    @Override
    public int updateSaleOrderItem(SaleOrderItem saleOrderItem)
    {
        return saleOrderItemMapper.updateSaleOrderItem(saleOrderItem);
    }

    /**
     * 批量删除销售订单明细
     * 
     * @param itemIds 需要删除的销售订单明细主键
     * @return 结果
     */
    @Override
    public int deleteSaleOrderItemByItemIds(String itemIds)
    {
        return saleOrderItemMapper.deleteSaleOrderItemByItemIds(Convert.toStrArray(itemIds));
    }

    /**
     * 删除销售订单明细信息
     * 
     * @param itemId 销售订单明细主键
     * @return 结果
     */
    @Override
    public int deleteSaleOrderItemByItemId(Long itemId)
    {
        return saleOrderItemMapper.deleteSaleOrderItemByItemId(itemId);
    }
}
